package com.ruoyi.business.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.LawyerTimeMapper;
import com.ruoyi.business.domain.LawyerTime;
import com.ruoyi.business.service.ILawyerTimeService;

/**
 * 律师的可服务时间Service业务层处理
 * 
 * @author liwenjing
 * @date 2021-05-20
 */
@Service
public class LawyerTimeServiceImpl implements ILawyerTimeService 
{
    @Autowired
    private LawyerTimeMapper lawyerTimeMapper;

    /**
     * 查询律师的可服务时间
     * 
     * @param id 律师的可服务时间ID
     * @return 律师的可服务时间
     */
    @Override
    public LawyerTime selectLawyerTimeById(Long id)
    {
        return lawyerTimeMapper.selectLawyerTimeById(id);
    }

    /**
     * 查询律师的可服务时间列表
     * 
     * @param lawyerTime 律师的可服务时间
     * @return 律师的可服务时间
     */
    @Override
    public List<LawyerTime> selectLawyerTimeList(LawyerTime lawyerTime)
    {
        return lawyerTimeMapper.selectLawyerTimeList(lawyerTime);
    }

    /**
     * 新增律师的可服务时间
     * 
     * @param lawyerTime 律师的可服务时间
     * @return 结果
     */
    @Override
    public int insertLawyerTime(LawyerTime lawyerTime)
    {
        lawyerTime.setLawyerCode(SecurityUtils.getUsername());
        return lawyerTimeMapper.insertLawyerTime(lawyerTime);
    }

    /**
     * 修改律师的可服务时间
     * 
     * @param lawyerTime 律师的可服务时间
     * @return 结果
     */
    @Override
    public int updateLawyerTime(LawyerTime lawyerTime)
    {
        return lawyerTimeMapper.updateLawyerTime(lawyerTime);
    }

    /**
     * 批量删除律师的可服务时间
     * 
     * @param ids 需要删除的律师的可服务时间ID
     * @return 结果
     */
    @Override
    public int deleteLawyerTimeByIds(Long[] ids)
    {
        return lawyerTimeMapper.deleteLawyerTimeByIds(ids);
    }

    /**
     * 删除律师的可服务时间信息
     * 
     * @param id 律师的可服务时间ID
     * @return 结果
     */
    @Override
    public int deleteLawyerTimeById(Long id)
    {
        return lawyerTimeMapper.deleteLawyerTimeById(id);
    }

    @Override
    public int updateLawyerTimeByTime(LawyerTime lawyerTime) {
        return lawyerTimeMapper.updateLawyerTimeByTime(lawyerTime);
    }

    @Override
    public String selectLawyerTimeByCode(LawyerTime lawyerTime) {
        return lawyerTimeMapper.selectLawyerTimeByCode(lawyerTime);
    }
}
